package model

import "gorm.io/gorm"

type Chat struct {
	gorm.Model
	UserId   int    `gorm:"type:int" json:"userId"`
	FriendId int    `gorm:"type:int" json:"friendId"`
	Content  string `gorm:"type:varchar(30)" json:"content"`
}

func (c *Chat) AddChat(db *gorm.DB) error {
	err := db.Create(&c).Error
	return err
}
